#pragma once
#include "iaeskey.h"
#include "IKeyManifest.h"
#include "AESUtils.h"
#include "AESEngine.h"

// forward declaration
class AESEngine;

class AESKey :
	public IAESKey
{
public:
	friend AESEngine;
	AESKey(void);
	AESKey(const IKeyManifest* kMan, const char* keyLabel);
	virtual ~AESKey(void);

	virtual int		PopulateKey		(void);
	virtual int		EraseKey		(void);
	virtual void	setLengthKey	(int nWords);
	virtual int		getLengthKey	(void);

	PKEY_STREAM		getKeyStream	(void);

private:
	const IKeyManifest* _kMan;				// the Man
	PKEY_STREAM			_key;				// byte stream
	string				_keyLabel;			// key alias in the system
	int					_kLengthWords;		// key length in words
};
